/**************************************************************************************************
 
  Phyplus Microelectronics Limited confidential and proprietary. 
  All rights reserved.

  IMPORTANT: All rights of this software belong to Phyplus Microelectronics 
  Limited ("Phyplus"). Your use of this Software is limited to those 
  specific rights granted under  the terms of the business contract, the 
  confidential agreement, the non-disclosure agreement and any other forms 
  of agreements as a customer or a partner of Phyplus. You may not use this 
  Software unless you agree to abide by the terms of these agreements. 
  You acknowledge that the Software may not be modified, copied, 
  distributed or disclosed unless embedded on a Phyplus Bluetooth Low Energy 
  (BLE) integrated circuit, either as a product or is integrated into your 
  products.  Other than for the aforementioned purposes, you may not use, 
  reproduce, copy, prepare derivative works of, modify, distribute, perform, 
  display or sell this Software and/or its documentation for any purposes.

  YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
  PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
  INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
  NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
  PHYPLUS OR ITS SUBSIDIARIES BE LIABLE OR OBLIGATED UNDER CONTRACT,
  NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
  LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
  INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
  OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
  OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
  (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
  
**************************************************************************************************/

/**************************************************************************************************
  Filename:       vendorModel.h
  Revised:         
  Revision:        

  Description:    This file contains the vendor model
                  definitions and prototypes.

 
**************************************************************************************************/

#ifndef VENDORMODEL_H
#define VENDORMODEL_H

#ifdef __cplusplus
extern "C"
{
#endif

/*********************************************************************
 * INCLUDES
 */
extern MS_ACCESS_MODEL_HANDLE   UI_vendor_defined_server_model_handle;


/*********************************************************************
 * CONSTANTS
 */

/* --------------------------------------------- Global Definitions */
//vendor model server/client
#define MS_MODEL_ID_VENDOR_EXAMPLE_SERVER                         0x00000504


//vendor model opcode
#define MS_ACCESS_VENDOR_EXAMPLE_GET_OPCODE                         0x00D00405
#define MS_ACCESS_VENDOR_EXAMPLE_SET_OPCODE                         0x00D10405
#define MS_ACCESS_VENDOR_EXAMPLE_SET_UNACKNOWLEDGED_OPCODE          0x00D20405
#define MS_ACCESS_VENDOR_EXAMPLE_STATUS_OPCODE                      0x00D30405
#define MS_ACCESS_VENDOR_EXAMPLE_WRITECMD_OPCODE                    0x00D40405
#define MS_ACCESS_VENDOR_EXAMPLE_INDICATION_OPCODE                  0x00D50405
#define MS_ACCESS_VENDOR_EXAMPLE_CONFIRMATION_OPCODE                0x00D60405
#define MS_ACCESS_VENDOR_EXAMPLE_NOTIFY_OPCODE                      0x00D70405

//vendor model att
#define MS_STATE_VENDOR_HSL_T                                   0x0123
#define MS_STATE_VENDOR_ONOFF_T                                 0x0100
#define MS_STATE_VENDOR_LIGHTNESS_T                             0x0121
#define MS_STATE_VENDOR_CTL_T                                   0x0122
#define MS_STATE_VENDOR_MAINLIGHTONOFF_T                        0x0534
#define MS_STATE_VENDOR_BACKLIGHTONOFF_T                        0x0533
#define MS_STATE_VENDOR_MODENUMBER_T                            0xF004
#define MS_STATE_VENDOR_EVENT_INDICATE_T                        0xF009

/** Vendor Model specific state parameters in a request or response message */
typedef struct _MS_access_vendor_model_state_params
{
    /** State Type */
    UINT16 state_type;

    /** State pointer */
    void * state;

}MS_ACCESS_VENDOR_MODEL_STATE_PARAMS;


/**
 * Vendor Example Server application Asynchronous Notification Callback.
 *
 * Vendor Example Server calls the registered callback to indicate events occurred to the
 * application.
 *
 * \param [in] ctx           Context of the message received for a specific model instance.
 * \param [in] msg_raw       Uninterpreted/raw received message.
 * \param [in] req_type      Requested message type.
 * \param [in] state_params  Model specific state parameters.
 * \param [in] ext_params    Additional parameters.
 */
typedef API_RESULT (* MS_VENDOR_EXAMPLE_SERVER_CB)
        (
            MS_ACCESS_MODEL_REQ_MSG_CONTEXT     * ctx,
            MS_ACCESS_MODEL_REQ_MSG_RAW         * msg_raw,
            MS_ACCESS_MODEL_REQ_MSG_T           * req_type,
            MS_ACCESS_VENDOR_MODEL_STATE_PARAMS * state_params,
            MS_ACCESS_MODEL_EXT_PARAMS          * ext_params

        ) DECL_REENTRANT;
typedef struct MS_state_vendor_example_struct
{
    UCHAR  value;

} MS_STATE_VENDOR_EXAMPLE_STRUCT;




/*********************************************************************
 * MACROS
 */


/*********************************************************************
 * FUNCTIONS
 */

/*
 * Task Initialization for the BLE Application
 */

/*
 * Task Event Processor for the BLE Application
 */

/*********************************************************************
*********************************************************************/

#ifdef __cplusplus
}
#endif

#endif /* BLEMESH_H */
